home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Games / SprocketInvaders / Source / Particles.h < prev    next >
Encoding:
Text File  |  2000-09-28  |  1.6 KB  |  64 lines  |  [TEXT/MPS ]

  1. //•    ------------------------------------------------------------------------------------------    •
  2. //•
  3. //•    Copyright © 1996 Apple Computer, Inc., All Rights Reserved
  4. //•
  5. //•
  6. //•        You may incorporate this sample code into your applications without
  7. //•        restriction, though the sample code has been provided "AS IS" and the
  8. //•        responsibility for its operation is 100% yours.  However, what you are
  9. //•        not permitted to do is to redistribute the source as "DSC Sample Code"
  10. //•        after having made changes. If you're going to re-distribute the source,
  11. //•        we require that you make it clear in the source that the code was
  12. //•        descended from Apple Sample Code, but that you've made changes.
  13. //•
  14. //•        Authors:
  15. //•            Chris De Salvo
  16. //•
  17. //•    ------------------------------------------------------------------------------------------    •
  18.  
  19. #ifndef __PARTICLES__
  20. #define __PARTICLES__
  21.  
  22. //•    ------------------------------    Includes
  23.  
  24. #include <QuickDraw.h>
  25.  
  26. //•    ------------------------------    Public Definitions
  27.  
  28. #define kNumSpecks                    50
  29.  
  30. //•    ------------------------------    Public Types
  31.  
  32. typedef struct Speck
  33. {
  34.     UInt32    age;
  35.     UInt32    lifeTime;
  36.     SInt32    h, v;
  37.     SInt32    speedH, speedV;
  38. } Speck, *SpeckPtr;
  39.  
  40. typedef struct Particles
  41. {
  42.     UInt32        numSpecks;
  43.     SpeckPtr    specks;
  44.     Rect        bounds;
  45.     UInt8        color;
  46. } Particles, *ParticlesPtr;
  47.  
  48. //•    ------------------------------    Public Variables
  49. //•    ------------------------------    Public Functions
  50.  
  51. #ifdef __cplusplus
  52. extern "C" {
  53. #endif
  54.  
  55. extern ParticlesPtr ParticlesAllocate(SInt32 x, SInt32 y, UInt8 color);
  56. extern void ParticlesDispose(ParticlesPtr *theParticles);
  57. extern Rect ParticlesDraw(ParticlesPtr, CGrafPtr dest);
  58.  
  59. #ifdef __cplusplus
  60. }
  61. #endif
  62.  
  63. #endif
  64.